package com.wkk.authorization.dto;

import com.wkk.verification.group.AddDto;
import com.wkk.verification.group.UpdateDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author : WangKeKe
 * @date : 2020/10/5 18:28
 * Description : 用于更新或添加 角色
 */

@Data
@Accessors(chain = true)
@ApiModel(description = "用于更新或添加角色")
public class AddOrUpdateRoleDto {

    @ApiModelProperty(value = "分布式ID")
    @Null(groups = AddDto.class, message = "添加角色时不能携带id")
    @NotEmpty(groups = UpdateDto.class, message = "更新时id不能为空")
    private String id;

    @Null(groups = UpdateDto.class, message = "角色描述不能修改")
    @NotEmpty(groups = {AddDto.class}, message = "角色名称不能为空")
    @ApiModelProperty(value = "角色描述")
    private String name;

    @NotNull(groups = {UpdateDto.class, AddDto.class}, message = "在线状态不能为空")
    @ApiModelProperty(value = "0->不上线 1->上线")
    private Integer status;

}
